//
//  GWHomeListCell.m
//  ShandsMod
//
//  Created by zh_s on 11/15/21.
//  Copyright © 2021 zh_s. All rights reserved.
//

#import "GWHomeListCell.h"

@implementation GWHomeListCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.accessoryType = UITableViewCellAccessoryNone;
        self.backgroundColor = [UIColor clearColor];
        [self createView];
    }
    return self;
}

- (void)createView {
    
    UILabel *titleLab = [[UILabel alloc] init];
    [self.contentView addSubview:titleLab];
    titleLab.textColor = MAIN_BACKCOLOR;
    titleLab.font = FONT_NAME(FONT_Regular, 16);
    titleLab.text = @"titleName";
    [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(10);
    }];
    self.titleLab = titleLab;
    
    UIView *lineView = [[UIView alloc] init];
    [self.contentView addSubview:lineView];
    lineView.backgroundColor = LINEVIEWCELL_BACKCOLOR;
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(50);
        make.centerY.mas_equalTo(titleLab.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH -20, 0.5));
    }];
    
    UILabel *cntentLab = [[UILabel alloc] init];
    [self.contentView addSubview:cntentLab];
    cntentLab.textColor = MAIN_BACKCOLOR;
    cntentLab.font = FONT_NAME(FONT_Regular, 16);
    cntentLab.text = @"titleName";
    cntentLab.numberOfLines = 0;
    [cntentLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(50);
        make.top.mas_equalTo(lineView.mas_bottom).mas_offset(10);
        make.right.mas_equalTo(self.contentView.mas_right).mas_offset(-16);
    }];
    self.contentLab = cntentLab;
}

@end
